// package: rewords-server-2024
// filename: system
// author: diogoxiang@gmail.com
// time: 2024/11/4 17:28

package system

import (
	"rewords-server-2024/internal/model/entity"
	"rewords-server-2024/internal/model/input/query_in"

	"github.com/gogf/gf/v2/frame/g"
)

// SysUserAddReq 增加用户
type SysUserAddReq struct {
	g.Meta `path:"/sys/user/add" method:"post" summary:"添加用户" tags:"系统"`
	entity.SysUser
}

// SysUserAddRes 返回参数 只返回一个uid
type SysUserAddRes struct {
	Uid int64 `json:"uid" summary:"用户UID"`
}

// SysUserInfoReq 请求参数
// @Description: 获取用户信息 单个
type SysUserInfoReq struct {
	g.Meta      `path:"/sys/user/query" method:"post" summary:"获取用户信息" tags:"系统"`
	Conditions  []query_in.Condition  `json:"conditions,omitempty" summary:"查找条件"`   // 查找字段
	OrderFields []query_in.OrderField `json:"order_fields,omitempty" summary:"排序字段"` // 排序字段
	//*query_in.Page `json:"page"`         // 分页
	//form.StatusReq
	//Status string `bson:"status" json:"status" summary:"状态"`
	//Uid    int64  `json:"uid" summary:"用户ID"`
	//Phone  string `bson:"phone" json:"phone"` // 手机号
}

// SysUserInfoRes 返回参数
type SysUserInfoRes struct {
	entity.SysUser
	//query_in.PageResult
}

// SysUserUpdateReq 更新用户
type SysUserUpdateReq struct {
	g.Meta `path:"/sys/user/update" method:"put" summary:"更新用户" tags:"系统"`
	entity.SysUser
}

// SysUserUpdateRes 返回参数
type SysUserUpdateRes struct {
	//Uid int64 `json:"uid" summary:"用户UID"`
}

// SysUserInfoListReq 请求参数 列表
type SysUserInfoListReq struct {
	g.Meta         `path:"/sys/user/list" method:"post" summary:"获取用户信息列表" tags:"系统"`
	Conditions     []query_in.Condition  `json:"conditions,omitempty" summary:"查找条件"`   // 查找字段
	OrderFields    []query_in.OrderField `json:"order_fields,omitempty" summary:"排序字段"` // 排序字段
	*query_in.Page `json:"page"`         // 分页
}

// SysUserInfoListRes 返回参数
type SysUserInfoListRes struct {
	Data []entity.SysUser `json:"list"`
	query_in.PageResult
}

type SysUserDeleteReq struct {
	g.Meta `path:"/sys/user/delete" method:"delete" summary:"删除用户" tags:"系统"`
	Uid    int64 `json:"uid" summary:"用户ID"`
}

type SysUserDeleteRes struct{}
